<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Goals',
	'<{subtitle}>' => 'My current objectives',
	'<{copyright year}>' => '2018',
	'<{body}>' => <<<END
<p>
	This page is just a way for me to keep my goals organised for the time being.
</p>

END
);

$temp = file_get_contents(__DIR__.'/../../../template/goal.xhtml');

foreach($goals as $key_id => $value_data):
	$xhtml['<{body}>'] .= strtr($temp, array(
		'<{id}>' => $key_id,
		'<{title}>' => $value_data['title'],
		'<{prereq}>' => $value_data['prerequisites'],
		'<{postreq}>' => $value_data['postrequisites'],
		'<{body}>' => $value_data['body'],
		'<{priority}>' => $value_data['priority'],
		'<{urgency}>' => $value_data['urgency'],
	));
endforeach;

unset($temp);
